<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->

  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php    header("Content-type: text/html; charset=utf-8");
require("conn.php");

?>
    

    <title>账号添加</title>
    <meta name="description" content="账号添加">
    <meta name="keywords" content="账号添加">


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    


    <!-- bootstrap-datetimepicker -->
    <!-- 页面meta /-->
<link rel="stylesheet" href="static/css/bootstrap.css">
    <link rel="stylesheet" href="static/css/bootstrap.min.css">
    <link rel="stylesheet" href="static/css/font-awesome.min.css">
    <link rel="stylesheet" href="static/css/ionicons.min.css">
    <link rel="stylesheet" href="static/css/blue.css">
    <link rel="stylesheet" href="static/css/morris.css">
    <link rel="stylesheet" href="static/css/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="static/css/datepicker3.css">
    <link rel="stylesheet" href="static/css/daterangepicker.css">
    <link rel="stylesheet" href="static/css/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="static/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="static/css/jquery.treetable.css">
    <link rel="stylesheet" href="static/css/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="static/css/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="static/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="static/css/AdminLTE.css">
    <link rel="stylesheet" href="static/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="static/css/style.css">
    <link rel="stylesheet" href="static/css/ion.rangeSlider.css">
    <link rel="stylesheet" href="static/css/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="static/css/slider.css">
    <link rel="stylesheet" href="static/css/bootstrap-datetimepicker.css">

    <link rel="shortcut icon" href="../img/ico/favicon.ico" type="image/x-icon"/>

    <!-- 富文本编辑器 -->
    <link rel="stylesheet" href="static/css/default.css">
    <script charset="utf-8" src="static/js/kindeditor-all.js"></script>
    <script charset="utf-8" src="static/js/zh-CN.js"></script>

    <script src="static/js/angular.min.js"></script>
    <script src="static/js/base.js"></script>
    <script src="static/js/baseController.js"></script>
    <script src="static/js/uploadService.js"></script>
    <script src="static/js/channelUserService.js"></script>
    <script src="static/js/brandService.js"></script>
    <script src="static/js/companyService.js"></script>
    <script src="static/js/taxInfoService.js"></script>
    <script src="static/js/companyController.js"></script>

<script src="static/js/jquery-2.2.3.min.js"></script>
<script src="static/js/jquery-ui.min.js"></script>
<script>
    
</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/raphael-min.js"></script>
<script src="static/js/morris.min.js"></script>
<script src="static/js/jquery.sparkline.min.js"></script>
<script src="static/js/jquery-jvectormap-1.2.2.min.js"></script>
<script src="static/css/jquery-jvectormap-world-mill-en.js"></script>
<script src="static/js/jquery.knob.js"></script>
<script src="static/js/moment.min.js"></script>
<script src="static/js/daterangepicker.js"></script>
<script src="static/js/daterangepicker.zh-CN.js"></script>
<script src="static/js/bootstrap-datepicker.js"></script>
<script src="static/js/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="static/js/bootstrap3-wysihtml5.all.min.js"></script>
<script src="static/js/jquery.slimscroll.min.js"></script>
<script src="static/js/fastclick.js"></script>
<script src="static/js/icheck.min.js"></script>
<script src="static/js/app.min.js"></script>
<script src="static/js/jquery.treetable.js"></script>
<script src="static/js/bootstrap-colorpicker.min.js"></script>
<script src="static/js/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="static/js/bootstrap-markdown.js"></script>
<script src="static/js/bootstrap-markdown.zh.js"></script>
<script src="static/js/markdown.js"></script>
<script src="static/js/to-markdown.js"></script>
<script src="static/js/ckeditor.js"></script>
<script src="static/js/jquery.inputmask.js"></script>
<script src="static/js/jquery.inputmask.date.extensions.js"></script>
<script src="static/js/jquery.inputmask.extensions.js"></script>
<script src="static/js/jquery.dataTables.min.js"></script>
<script src="static/js/dataTables.bootstrap.min.js"></script>
<script src="static/js/Chart.min.js"></script>
<script src="static/js/jquery.flot.min.js"></script>
<script src="static/js/jquery.flot.resize.min.js"></script>
<script src="static/js/jquery.flot.pie.min.js"></script>
<script src="static/js/jquery.flot.categories.min.js"></script>
<script src="static/js/ion.rangeSlider.min.js"></script>
<script src="static/js/bootstrap-slider.js"></script>
<script src="static/js/bootstrap-datetimepicker.js"></script>
<script src="static/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="static/js/laydate.js"></script>
<script type="text/javascript"></script>
</head>
<?php  
$id=@$_GET['id'];

?>

<body>

<!-- 内容区域 -->
<div class="box-body">

    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            账号添加
            <small>账号添加表单</small>
        </h1>
        <ol class="breadcrumb">

            <li><i class="fa fa-file-text"></i> <a href="#">账号</a></li>
            <li class="active">账号添加</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
   

        <div class="box-body">

            <!--tab页-->
            <div class="nav-tabs-custom">

                <!--tab头-->

                <!--tab头/-->

                <!--tab内容-->
                <div class="tab-content">

                    <!--账号-->
                    <div class="panel panel-default">
                        

                        <div id="dayslist" class="panel-body">

                            <div class="box box-primary">

                                <div class="box-body">

                                    <!--tab头-->
                          
                                    <!--tab头/-->
                                    <!--tab内容-->     

<?php 


$action=@$_GET['action'];


  $action=@$_GET['action'];
if($action=="add"){
    $username=@$_POST['username'];
    $ming=@$_POST['ming'];
    $tel=@$_POST['tel'];
    $idcard=@$_POST['idcard'];
	 $age=@$_POST['age'];
     $sex=@$_POST['sex'];
    $password=@$_POST['password'];
	$password2=@$_POST['password2'];
     if($tel==""){
	    echo "<script language='javascript'>alert('请输入手机号！');history.go(-1)</script>";
     return false;
	 }
	    if($idcard==""){
	    echo "<script language='javascript'>alert('请输入身份证！');history.go(-1)</script>";
     return false;
	 }
	    if($username==""){
	    echo "<script language='javascript'>alert('请输入账号！');history.go(-1)</script>";
     return false;
	 }
	    if($ming==""){
	    echo "<script language='javascript'>alert('请输入真实姓名！');history.go(-1)</script>";
     return false;
	 }
     if($password!=$password2){
        echo "<script language='javascript'>alert('两次密码输入不一致！');history.go(-1)</script>";
     return false;
     }
     if($password==""){
        echo "<script language='javascript'>alert('请输入密码！');history.go(-1)</script>";
     return false;
     }

 $password=md5($password);
	$sql1="INSERT INTO user(ming,tel,username,idcard,age,sex,password) VALUES ('".$ming."','".$tel."','".$username."','".$idcard."','".$age."','".$sex."','".$password."')";

  if (mysql_query($sql1)){ 

      echo "<script language='javascript'>alert('添加成功！');window.location.href='?lei=qq&a=reg';</script>";
     }else{
	    echo  $sql1;
   echo "<script language='javascript'>alert('添加失败！');history.go(-1)</script>";
     }
     }



          
?>         
                    <form id="myform"  name="myform" action="?action=add" method="post">
                                    <div class="tab-content">
                <!--表单内容-->
        <div class="tab-pane active" id="home">
            <div class="row data-type">
                <div class="col-md-2 title">账号</div>
            <div class="col-md-10 data">
                    <input type="text" class="form-control" name="username" value=""></div>  
                    <div class="col-md-2 title">密码</div>
                <div class="col-md-10 data">
                    <input type="text" class="form-control" name="password" value=""></div>
                    <div class="col-md-2 title">再次输入密码</div>
                <div class="col-md-10 data">
                    <input type="text" class="form-control" name="password2" value=""></div>
                <div class="col-md-2 title">姓名</div>
                <div class="col-md-10 data">
                    <input type="text" class="form-control" name="ming" value=""></div>
                    <div class="col-md-2 title">年龄</div>
                <div class="col-md-10 data">
                    <input type="text" class="form-control" name="age" value=""></div>
                    <div class="col-md-2 title">性别</div>
                 <div class="col-md-10 data">
                                             <select class="editors-select" name="sex" >
                                <option selected="selected" value="男" >男</option>
                                 <option  value="女" >女</option>
                            </select>
                                        </div>
					 <div class="col-md-2 title">身份证号</div>
                <div class="col-md-10 data">
                    <input type="text" class="form-control" name="idcard" value=""></div>
					 <div class="col-md-2 title">手机号</div>
					    <div class="col-md-10 data">
                    <input type="text" class="form-control" name="tel" value=""></div>
                
                                                                     
                                    </div>
                                </div>

                                

                                      


                                    </div>
                
                
               
               <!--tab内容/-->


                                </div>
                            </div>


                        </div>
                    </div>
                    <!--账号/-->


                    <!--工具栏-->
                    <div class="box-tools text-center">
                        <input type="submit" class="btn bg-maroon ng-scope" value="添加">
                        </input>
                        <input type="button" class="btn bg-default" onClick="history.back(-1);" value="返回"></input>
</form>
                    </div>
                    <!--工具栏/-->

                </div>
                <!--表单内容/-->

            </div>
            <!--tab内容/-->

        </div>
        <!--tab页/-->


    

    <!-- 正文区域 /-->

</div>
<!-- 内容区域 /-->

<!-- 底部导航 -->

<!-- 底部导航 /-->



</body>

</html>
<script language="javascript" charset="utf-8">
function init(i) {
    var windowWidth, windowHeight;
    windowWidth=$(window).width();
    windowHeight=$(window).height();
    if(i==1){
        $("#k_btn1").hide();
        $("#k_btn2").show();
        $("#k_left").hide();
        $("#k_right").width(windowWidth-3);
    }
    else if(i==2){
        $("#k_btn2").hide();
        $("#k_btn1").show();
        $("#k_left").show();
        $("#k_right").width(windowWidth-193);
    }
    else {
        $("#k_left").height(windowHeight-158);
        $("#f_left").height(windowHeight-158);
        $("#k_btn1").css("top",(windowHeight-158-58)/2+"px");
        $("#k_btn2").css("top",(windowHeight-158-58)/2+"px");
        $("#k_right").width(windowWidth-193);
        $("#k_right").height(windowHeight-158);
        iFrame = $("#main");
        iFrame.height(windowHeight-158);
    }
}
$(document).ready(function() {
    init(0);
    window.onresize = function() {
        init(0);
    }
});
</script>